<%@page import="domain.model.TrackIp"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Collections"%>
<%@page import="javax.cache.CacheException"%>
<%@page import="javax.cache.CacheManager"%>
<%@page import="javax.cache.Cache"%>
<%@page import="domain.model.Whois"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html;charset=UTF-8" language="java"%>
<%
String title = (String) request.getAttribute("title");
String description = (String) request.getAttribute("description");
String keywords = (String) request.getAttribute("keyword");
List<TrackIp> ip = (List<TrackIp>)request.getAttribute("ip");
List<TrackIp> ipList = (List<TrackIp>)request.getAttribute("ipList");
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keywords %>"/>
</jsp:include>
		<div class="body all">
			<div class="cate">
				<%@ include file='/element/menu_left.jsp'%>
				<%@ include file='/element/new_site.jsp'%>
				<%@ include file='/element/random_site.jsp'%>
			</div>
			<div class="content">
				<%@ include file='/adv/menu.jsp'%>
				
				<div class="content_left left">
					<h2 class="title left">Lookup Ip :</h2>
					<div class="add_this right">
						<!-- AddThis Button BEGIN -->
						<div class="addthis_toolbox addthis_default_style ">
						<a class="addthis_button_preferred_1"></a>
						<a class="addthis_button_preferred_2"></a>
						<a class="addthis_button_preferred_3"></a>
						<a class="addthis_button_preferred_4"></a>
						<a class="addthis_button_compact"></a>
						<a class="addthis_counter addthis_bubble_style"></a>
						</div>
						
						<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4d6f3cdb1d190d60"></script>
						<!-- AddThis Button END -->
					</div>
					<div class="sum_one right">
						<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
						<g:plusone size="small" count="true"></g:plusone>
					</div>
					<div class="clear"></div>
					
					<form action="/search-ip" class="search">
						<input type="text" name="name"/>
						<button>Lookup Ip</button>
						<br/>
						Example Searches : <a href="/ip/75.126.102.228">75.126.102.228</a> , <a href="/ip/67.228.81.180">67.228.81.180</a>
					</form>
		
					<br/>
					<h2 class="title">Ip : <%=ip.get(0).getIp() %></h2>
					<ul class="detail_ip">
						<li>
							<div class="ip_left">ISP:</div>
							<div class="ip_right"><%=(ip.get(0).getJsp()!=null&&!ip.get(0).getJsp().equals(""))?ip.get(0).getJsp():"-" %></div>
						</li>
						<li>
							<div class="ip_left">Organization:</div>
							<div class="ip_right"><%=(ip.get(0).getOrganization()!=null&&!ip.get(0).getOrganization().equals(""))?ip.get(0).getOrganization():"-" %></div>
						</li>
						<li>
							<div class="ip_left">Proxy:</div>
							<div class="ip_right"><%=(ip.get(0).getProxy()!=null&&!ip.get(0).getProxy().equals(""))?ip.get(0).getProxy():"-" %></div>
						</li>
						<li>
							<div class="ip_left">Type:</div>
							<div class="ip_right"><%=(ip.get(0).getType()!=null&&!ip.get(0).getType().equals(""))?ip.get(0).getType():"-" %></div>
						</li>
						<li>
							<div class="ip_left">Assignment:</div>
							<div class="ip_right"><%=(ip.get(0).getAssignment()!=null&&!ip.get(0).getAssignment().equals(""))?ip.get(0).getAssignment():"-" %></div>
						</li>
						<li>
							<div class="ip_left">Country:</div>
							<div class="ip_right"><%=(ip.get(0).getCountry()!=null&&!ip.get(0).getCountry().equals(""))?ip.get(0).getCountry():"-" %></div>
						</li>
						<li>
							<div class="ip_left">State/Region:</div>
							<div class="ip_right"><%=(ip.get(0).getState()!=null&&!ip.get(0).getState().equals(""))?ip.get(0).getState():"-" %></div>
						</li>
						<li>
							<div class="ip_left">City:</div>
							<div class="ip_right"><%=(ip.get(0).getCity()!=null&&!ip.get(0).getCity().equals(""))?ip.get(0).getCity():"-" %></div>
						</li>
					</ul>
					<ul class="same_ip">
						<%
						if(ipList.size()>0)
						{
							for(int i=0;i<ipList.size();i++)
							{
						%>
								<li><a href="/ip/<%=ipList.get(i).getIp() %>"><%=ipList.get(i).getIp() %></a></li>
						<%
							}
						}
						%>
					</ul>
					<div class="clear"></div>
					<br/>
					<h2 class="title">Other sites hosted on <%=ip.get(0).getIp() %></h2>
					<ul class="recent">
						<%=(request.getAttribute("sameip") != null && !request.getAttribute("sameip").equals(""))?request.getAttribute("sameip"):"Unknown" %>
					</ul>
					<div class="clear"></div>
					<br/>
					<h2 class="title">Whois ip <%=ip.get(0).getIp() %></h2>
					<div class="whois_ip">
						<%=(ip.get(0).getWhoisIp()!=null)?ip.get(0).getWhoisIp().getValue():"" %>
					</div>
				</div>
				<div class="content_right right">
					<%@ include file='/adv/right.jsp'%>
				</div>
			</div>
			<div class="clear"></div>
		</div>
<%@ include file='/layout/footer.jsp'%>